# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 39
n 39(None)[return False
]:
	i: 30(), 38()
	o: 

nname: 38
n 38(None)[]:
	i: 0&10(f)
	o: 39()

nname: 30
n 30(None)[return True
]:
	i: 0&10(t)
	o: 39()

nname: 0&10
n 0&10(context['parent_mode'] and context['menu'].type in ('video_image', 'audio', 'image', 'video', 'multiverse'))[]:
	i: 
	o: 30(t), 38(f)

nname: 0&10
n 0&10(None)[if context['parent_mode'] and context['menu'].type in ('video_image', 'audio', 'image', 'video', 'multiverse'):
	return True
return False
]:
	i: 
	o: 

self.nodes: {'0&10': <unpyclib.structure.node instance at 0xb757566c>}
nname: 248
n 248(None)[fl.clear()
menu = context['menu']
menu.reload_func()
menu._update_marker()
]:
	i: 28(), 52(), 152(JA), 199(), 246(AE)
	o: 

nname: 246
n 246(None)[]:
	i: 113(f)
	o: 248(AE)

nname: 199
n 199(None)[MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
]:
	i: 124(f)
	o: 248()

nname: 152
n 152(None)[BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
]:
	i: 124(t)
	o: 248(JA)

nname: 124
n 124(e.message == 'NOT_SUPPORTED_BY_FS')[#, e
PRINT_EXCEPTION()
]:
	i: 113(t)
	o: 152(t), 199(f)

nname: 113
n 113(<dummy_ex3> EXC_MATCH NotPermittedError)[]:
	i: 42(f)
	o: 124(t), 246(f)

nname: 52
n 52(None)[PRINT_EXCEPTION()
MessageWindow(text=_('Error removing %s') % 'markerlist', title=_('Error')).show(timeout=5)
]:
	i: 42(t)
	o: 248()

nname: 42
n 42(<dummy_ex3> EXC_MATCH RemoveError)[]:
	i: 0(except)
	o: 52(t), 113(f)

nname: 28
n 28(None)[fl.vfs_delete()
]:
	i: 0(try)
	o: 248()

nname: 0
n 0(None)[fl = markerlists().get(context['menu'].universe)
]:
	i: 
	o: 28(try), 42(except)

nname: 42
n 42(None)[except RemoveError:
	PRINT_EXCEPTION()
	MessageWindow(text=_('Error removing %s') % 'markerlist', title=_('Error')).show(timeout=5)
except:
	except NotPermittedError, e:
		PRINT_EXCEPTION()
		if e.message == 'NOT_SUPPORTED_BY_FS':
			BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
		else:
			MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
fl.clear()
menu = context['menu']
menu.reload_func()
menu._update_marker()
]:
	i: 0()
	o: 

nname: 0
n 0(None)[fl = markerlists().get(context['menu'].universe)
try:
	fl.vfs_delete()
]:
	i: 
	o: 42()

nname: 0
n 0(None)[fl = markerlists().get(context['menu'].universe)
try:
	fl.vfs_delete()
except RemoveError:
	PRINT_EXCEPTION()
	MessageWindow(text=_('Error removing %s') % 'markerlist', title=_('Error')).show(timeout=5)
except:
	except NotPermittedError, e:
		PRINT_EXCEPTION()
		if e.message == 'NOT_SUPPORTED_BY_FS':
			BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
		else:
			MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
fl.clear()
menu = context['menu']
menu.reload_func()
menu._update_marker()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb757c50c>}
nname: 118
n 118(None)[]:
	i: 93(), 117()
	o: 

nname: 117
n 117(None)[]:
	i: 0&73(f)
	o: 118()

nname: 93
n 93(None)[context['menu'].contextual_windows.append(win)
]:
	i: 0&73(t)
	o: 118()

nname: 0&73
n 0&73(context['menu'] and hasattr(context['menu'], 'contextual_windows'))[def __do_delete():
	fl = markerlists().get(context['menu'].universe)
	try:
		fl.vfs_delete()
	except RemoveError:
		PRINT_EXCEPTION()
		MessageWindow(text=_('Error removing %s') % 'markerlist', title=_('Error')).show(timeout=5)
	except:
		except NotPermittedError, e:
			PRINT_EXCEPTION()
			if e.message == 'NOT_SUPPORTED_BY_FS':
				BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
			else:
				MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
	fl.clear()
	menu = context['menu']
	menu.reload_func()
	menu._update_marker()

context['parent'].show_menu()
win = ConfirmWindow(_('Are you sure ?'), confirm_action=__do_delete)
win.show()
]:
	i: 
	o: 93(t), 117(f)

nname: 0&73
n 0&73(None)[def __do_delete():
	fl = markerlists().get(context['menu'].universe)
	try:
		fl.vfs_delete()
	except RemoveError:
		PRINT_EXCEPTION()
		MessageWindow(text=_('Error removing %s') % 'markerlist', title=_('Error')).show(timeout=5)
	except:
		except NotPermittedError, e:
			PRINT_EXCEPTION()
			if e.message == 'NOT_SUPPORTED_BY_FS':
				BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
			else:
				MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
	fl.clear()
	menu = context['menu']
	menu.reload_func()
	menu._update_marker()

context['parent'].show_menu()
win = ConfirmWindow(_('Are you sure ?'), confirm_action=__do_delete)
win.show()
if context['menu'] and hasattr(context['menu'], 'contextual_windows'):
	context['menu'].contextual_windows.append(win)
]:
	i: 
	o: 

self.nodes: {'0&73': <unpyclib.structure.node instance at 0xb7575dac>}
nname: 0
n 0(None)[from __future__ import absolute_import
from peewee.debug import log, PRINT_EXCEPTION
from pygui.markerlist import get_marker_from_item, markerlists, marker_list_remove, get_root
from pygui.window import ConfirmWindow, MessageWindow, BigMessageWindow
from wymedia.wmplus import RemoveError, NotPermittedError
caption = 'Delete marked items'
def is_compatible(context):
	if context['parent_mode'] and context['menu'].type in ('video_image', 'audio', 'image', 'video', 'multiverse'):
		return True
	return False

def execute(context):
	def __do_delete():
		fl = markerlists().get(context['menu'].universe)
		try:
			fl.vfs_delete()
		except RemoveError:
			PRINT_EXCEPTION()
			MessageWindow(text=_('Error removing %s') % 'markerlist', title=_('Error')).show(timeout=5)
		except:
			except NotPermittedError, e:
				PRINT_EXCEPTION()
				if e.message == 'NOT_SUPPORTED_BY_FS':
					BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
				else:
					MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
		fl.clear()
		menu = context['menu']
		menu.reload_func()
		menu._update_marker()

	context['parent'].show_menu()
	win = ConfirmWindow(_('Are you sure ?'), confirm_action=__do_delete)
	win.show()
	if context['menu'] and hasattr(context['menu'], 'contextual_windows'):
		context['menu'].contextual_windows.append(win)

]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb756b9ac>}
from __future__ import absolute_import
from peewee.debug import log, PRINT_EXCEPTION
from pygui.markerlist import get_marker_from_item, markerlists, marker_list_remove, get_root
from pygui.window import ConfirmWindow, MessageWindow, BigMessageWindow
from wymedia.wmplus import RemoveError, NotPermittedError
caption = 'Delete marked items'
def is_compatible(context):
	if context['parent_mode'] and context['menu'].type in ('video_image', 'audio', 'image', 'video', 'multiverse'):
		return True
	return False

def execute(context):
	def __do_delete():
		fl = markerlists().get(context['menu'].universe)
		try:
			fl.vfs_delete()
		except RemoveError:
			PRINT_EXCEPTION()
			MessageWindow(text=_('Error removing %s') % 'markerlist', title=_('Error')).show(timeout=5)
		except:
			except NotPermittedError, e:
				PRINT_EXCEPTION()
				if e.message == 'NOT_SUPPORTED_BY_FS':
					BigMessageWindow(text=_('The way this disk was formatted does not allow this operation'), title=_('Error')).show(timeout=5)
				else:
					MessageWindow(text=_('Operation not permitted'), title=_('Error')).show(timeout=5)
		fl.clear()
		menu = context['menu']
		menu.reload_func()
		menu._update_marker()

	context['parent'].show_menu()
	win = ConfirmWindow(_('Are you sure ?'), confirm_action=__do_delete)
	win.show()
	if context['menu'] and hasattr(context['menu'], 'contextual_windows'):
		context['menu'].contextual_windows.append(win)

